package com.hao.spring.aop;

import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

/**
 * TODO
 *
 * @author 97472
 * @version 1.0
 * @date 2021/11/3 17:16
 */
@Component
@Aspect
public class MemberProxy {
    @Pointcut(value = "execution(* com.hao.spring.aop.Member.add(..))")
    public void point(){

    }
    // 前置通知
    @Before(value = "point()")
    public void before(){
        System.out.println("before...........");
    }
    // 后置通知
    @AfterReturning(value = "execution(* com.hao.spring.aop.Member.add(..))")
    public void afterReturning(){
        System.out.println("afterReturning...........");
    }
//    // 环绕通知
//    @Around(value = "execution(* com.hao.spring.aop.Member.add(..))")
//    public void around(){
//        System.out.println("around...........");
//    }
    // 异常通知
//    @AfterThrowing(value = "execution(* com.hao.spring.aop.Member.add(..))")
//    public void exception(){
//        System.out.println("exception...........");
//    }
    // 最终通知
    @After(value = "execution(* com.hao.spring.aop.Member.add(..))")
    public void after(){
        System.out.println("after...........");
    }

}
